﻿<Window x:Class="DemoApp.Window1"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:DiagramDesigner;assembly=DiagramDesigner"
        xmlns:local="clr-namespace:DemoApp"
        WindowState="Maximized"
        SnapsToDevicePixels="True"
		Title="Diagram Designer"        
		Height="850" Width="1100">
	

    <Window.InputBindings>
        <KeyBinding Key="Del"
                    Command="{Binding DeleteSelectedItemsCommand}" />
    </Window.InputBindings>
	
	<DockPanel Margin="0">
		<ToolBar Height="35" DockPanel.Dock="Top">
			<Button ToolTip="New"
                    Content="New"
					Margin="8,0,3,0"
                    Command="{Binding CreateNewDiagramCommand}"/>
            <Button ToolTip="Save"
                    Content="Save"
                    Margin="8,0,3,0"
                    Command="{Binding SaveDiagramCommand}" />

            <Label Margin="30,0,3,0"
                   VerticalAlignment="Center"
                   Content="Saved Diagrams" />
            <ComboBox Margin="8,0,3,0"
                     Width="200"
                     ToolTip="Saved Diagrams"
                      SelectedItem="{Binding SavedDiagramId}"
                     ItemsSource="{Binding SavedDiagrams}"/>
            <Button ToolTip="Load Selected Diagram"
                    Content="Load"
                    Margin="8,0,3,0"
                    Command="{Binding LoadDiagramCommand}" />
            <ProgressBar Margin="8,0,3,0"
                         Visibility="{Binding Path=IsBusy, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"
                         IsIndeterminate="True"
                         Width="150"
                         Height="20"
                         VerticalAlignment="Center" />


        </ToolBar>
		
		<Grid Margin="0,5,0,0">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="230" />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>

            <!-- ToolBox Control -->
            <local:ToolBoxControl Grid.Column="0"
                                  DataContext="{Binding ToolBoxViewModel}" />

            <GridSplitter Grid.Column="1"
						  HorizontalAlignment="Left"
						  VerticalAlignment="Stretch"
						  Background="Transparent"
						  Width="3" />
        
            <!-- Diagram Control -->
            <s:DiagramControl Grid.Column="1"
                                  DataContext="{Binding DiagramViewModel}"
                                  Margin="3,1,0,0" />
        </Grid>
	</DockPanel>    
	
</Window>
